/* model */
import { BaseSelectUserVuexPropertyEnum } from '@src/component/common/BaseSelectUser/store'
/* store */
import { useBaseSelectUserStore } from '@src/component/common/BaseSelectUser/store/hooks/base'
/* vue */
import { computed } from 'vue'
/* types */
import { 
  BaseSelectUserGetDepartmentListModel,
  BaseSelectUserGetDepartmentUserListModel,
  BaseSelectUserGetRoleListModel, 
  BaseSelectUserGetRoleUserListModel, 
  BaseSelectUserGetSearchMoreUserListModel, 
  BaseSelectUserGetServiceProviderListModel, 
  BaseSelectUserGetServiceProviderUserListModel 
} from '@src/component/common/BaseSelectUser/types'

/** 
 * @description 选人控件 部门列表参数
*/
function useBaseSelectUserStoreDepartmentListParams() {
  
  const store = useBaseSelectUserStore()
  
  const departmentListParams = computed(() => store.state.departmentListParams)
  
  const setDepartmentListParams = (params: BaseSelectUserGetDepartmentListModel) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetDepartmentListParams, params)
  }
  
  return {
    departmentListParams,
    setDepartmentListParams
  }
}

/** 
 * @description 选人控件 部门人员列表参数
*/
function useBaseSelectUserStoreDepartmentUserListParams() {
  
  const store = useBaseSelectUserStore()
  
  const departmentUserListParams = computed(() => store.state.departmentUserListParams)
  
  const setDepartmentUserListParams = (params: BaseSelectUserGetDepartmentUserListModel) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetDepartmentUserListParams, params)
  }
  
  return {
    departmentUserListParams,
    setDepartmentUserListParams
  }
}

/** 
 * @description 选人控件 角色列表参数
*/
function useBaseSelectUserStoreRoleListParams() {
  
  const store = useBaseSelectUserStore()
  
  const roleListParams = computed(() => store.state.roleListParams)
  
  const setRoleListParams = (params: BaseSelectUserGetRoleListModel) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetRoleListParams, params)
  }
  
  return {
    roleListParams,
    setRoleListParams
  }
}

/** 
 * @description 选人控件 角色人员列表参数
*/
function useBaseSelectUserStoreRoleUserListParams() {
  
  const store = useBaseSelectUserStore()
  
  const roleUserListParams = computed(() => store.state.roleUserListParams)
  
  const setRoleUserListParams = (params: BaseSelectUserGetRoleUserListModel) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetRoleUserListParams, params)
  }
  
  return {
    roleUserListParams,
    setRoleUserListParams
  }
}

/** 
 * @description 选人控件 服务商列表参数
*/
function useBaseSelectUserStoreServiceProviderListParams() {
  
  const store = useBaseSelectUserStore()
  
  const serviceProviderListParams = computed(() => store.state.serviceProviderListParams)
  
  const setServiceProviderListParams = (params: BaseSelectUserGetServiceProviderListModel) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetServiceProviderListParams, params)
  }
  
  return {
    serviceProviderListParams,
    setServiceProviderListParams
  }
}

/** 
 * @description 选人控件 服务商人员列表参数
*/
function useBaseSelectUserStoreServiceProviderUserListParams() {
  
  const store = useBaseSelectUserStore()
  
  const serviceProviderUserListParams = computed(() => store.state.serviceProviderUserListParams)
  
  const setServiceProviderUserListParams = (params: BaseSelectUserGetServiceProviderUserListModel) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetServiceProviderUserListParams, params)
  }
  
  return {
    serviceProviderUserListParams,
    setServiceProviderUserListParams
  }
}

/** 
 * @description 选人控件 搜索更多用户列表参数
*/
function useBaseSelectUserStoreSearchMoreUserListParams() {
  
  const store = useBaseSelectUserStore()
  
  const searchMoreUserListParams = computed(() => store.state.searchMoreUserListParams)
  
  const setSearchMoreUserListParams = (params: BaseSelectUserGetSearchMoreUserListModel) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetSearchMoreUserListParams, params)
  }
  
  return {
    searchMoreUserListParams,
    setSearchMoreUserListParams
  }
}

export {
  useBaseSelectUserStoreDepartmentListParams,
  useBaseSelectUserStoreDepartmentUserListParams,
  useBaseSelectUserStoreRoleListParams,
  useBaseSelectUserStoreRoleUserListParams,
  useBaseSelectUserStoreServiceProviderListParams,
  useBaseSelectUserStoreServiceProviderUserListParams,
  useBaseSelectUserStoreSearchMoreUserListParams,
}
